package dilmaj.shared;

import com.google.gwt.user.client.rpc.IsSerializable;

import dilmaj.client.AreaJDO;
import dilmaj.client.CommentJDO;
import dilmaj.client.TermJDO;

public class CommentVO implements IsSerializable {
	private String text;
	private Long id;
	private Long userId;
	private String userName;
	private String anyUser;
	
	public CommentVO(CommentJDO commentJDO) {
		id=commentJDO.getId();
		
		if (commentJDO.getText()==null)
			text="";
		else
			text=commentJDO.getText();

		if (commentJDO.getUserID()==null)
			userId=new Long(0);
		else
			userId=commentJDO.getUserID();
		
		if (commentJDO.getUsername()==null)
			userName="";
		else
			userName=commentJDO.getUsername();
		
		if (commentJDO.getAnyUser()==null)
			anyUser="";
		else
			anyUser=commentJDO.getAnyUser();
	}
	
	public CommentVO(String text) {
		this.text=text;
	}
	
	public CommentVO(Long id, String text) {
		this.id=id;
		this.text=text;
	}
	
	public CommentVO() {
		
	}
	
	public String getText() {
		return text;
	}
	
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id=id;
	}
	
	public String getAnyUser() {
		return anyUser;
	}
	
	public String getUsername() {
		return userName;
	}
	
	public Long getUserID() {
		return userId;
	}
	
	public void setUserID(Long userid) {
		this.userId=userid;
	}
	
	public void setUserName(String userName) {
		this.userName=userName;
	}
	
	public void setAnyUser(String anyUser) {
		this.anyUser=anyUser;
	}
}
